﻿using System;
using BaseInfo;
using Microsoft.EntityFrameworkCore;
using StackExchange.Redis;
using Stock;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
using Vouchers;


public static class WmsDbContextModelCreatingExtensions
{
    public static void ConfigureWms(
        this ModelBuilder builder,
        Action<WmsModelBuilderConfigurationOptions> optionsAction = null)
    {
        Check.NotNull(builder, nameof(builder));

        var options = new WmsModelBuilderConfigurationOptions();

        optionsAction?.Invoke(options);

        builder.Entity<AgencyProduct>(s =>
        {
            s.ToTable("t_base_agencyproduct");
            s.ConfigureByConvention();
        });

        builder.Entity<DeptProduct>(s =>
        {
            s.ToTable("t_base_deptproduct");
            s.ConfigureByConvention();
        });

        builder.Entity<Manufacturer>(s =>
        {
            s.ToTable("t_base_manufacturer");
            s.ConfigureByConvention();
        });

        builder.Entity<ProductClass>(s =>
        {
            s.ToTable("t_base_productclass");
            s.ConfigureByConvention();
        });

        builder.Entity<Supplier>(s =>
        {
            s.ToTable("t_base_supplier");
            s.ConfigureByConvention();
        });

        builder.Entity<FlowStock>(s =>
        {
            s.ToTable("t_flowstock");
            s.ConfigureByConvention();
        });

        builder.Entity<LockStock>(s =>
        {
            s.ToTable("t_lockstock");
            s.ConfigureByConvention();
        });

        builder.Entity<ProductTrackStock>(s =>
        {
            s.ToTable("t_producttrackstock");
            s.ConfigureByConvention();
        });

        builder.Entity<AllotVoucher>(s =>
        {
            s.ToTable("t_allotvoucher");
            s.ConfigureByConvention();
        });

        builder.Entity<AllotVoucherDetail>(s =>
        {
            s.ToTable("t_allotvoucherdetail");
            s.ConfigureByConvention();
        });

        builder.Entity<ConsumeVoucher>(s =>
        {
            s.ToTable("t_consumevoucher");
            s.ConfigureByConvention();
        });

        builder.Entity<ConsumeVoucherDetail>(s =>
        {
            s.ToTable("t_consumevoucherdetail");
            s.ConfigureByConvention();
        });

        builder.Entity<InStockVoucher>(s =>
        {
            s.ToTable("t_instockvoucher");
            s.ConfigureByConvention();
        });

        builder.Entity<InStockVoucherDetail>(s =>
        {
            s.ToTable("t_instockvoucherdetail");
            s.ConfigureByConvention();
        });

        builder.Entity<OrderVoucher>(s =>
        {
            s.ToTable("t_ordervoucher");
            s.ConfigureByConvention();
        });

        builder.Entity<OrderVoucherDetail>(s =>
        {
            s.ToTable("t_ordervoucherdetail");
            s.ConfigureByConvention();
        });

        builder.Entity<OutStockVoucher>(s =>
        {
            s.ToTable("t_outstockvoucher");
            s.ConfigureByConvention();
        });

        builder.Entity<OutStockVoucherDetail>(s =>
        {
            s.ToTable("t_outstockvoucherdetail");
            s.ConfigureByConvention();
        });

        builder.Entity<PackVoucher>(s =>
        {
            s.ToTable("t_packvoucher");
            s.ConfigureByConvention();
        });

        builder.Entity<PackVoucherDetail>(s =>
        {
            s.ToTable("t_packvoucherdetail");
            s.ConfigureByConvention();
        });

        builder.Entity<RegressionVoucher>(s =>
        {
            s.ToTable("t_regressionVoucher");
            s.ConfigureByConvention();
        });

        builder.Entity<RegressionVoucherDetail>(s =>
        {
            s.ToTable("t_regressionvoucherdetail");
            s.ConfigureByConvention();
        });

        builder.Entity<RejectStockVoucher>(s =>
        {
            s.ToTable("t_rejectstockvoucher");
            s.ConfigureByConvention();
        });

        builder.Entity<RejectStockVoucherDetail>(s =>
        {
            s.ToTable("t_rejectstockvoucherdetail");
            s.ConfigureByConvention();
        });

        builder.Entity<ReturnStockVoucher>(s =>
        {
            s.ToTable("t_returnstockvoucher");
            s.ConfigureByConvention();
        });


        builder.Entity<ReturnStockVoucherDetail>(s =>
        {
            s.ToTable("t_returnstockvoucherdetail");
            s.ConfigureByConvention();
        });

        builder.Entity<UnPackVoucher>(s =>
        {
            s.ToTable("t_unpackvoucher");
            s.ConfigureByConvention();
        });

        builder.Entity<UnPackVoucherDetail>(s =>
        {
            s.ToTable("t_unpackvoucherdetail");
            s.ConfigureByConvention();
        });

      

    }
}
